<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
       $this-> display();
    }
	
	public function login(){
		
		//phpinfo();
		$user = $_POST["userName"];
		$pass = $_POST["pass"];
		//$userM = M("user");
		// $f = $userM->where("userName='%s'  and password='%s'",array($user,$pass))->select();
		// if($f){
			// $this->display();
		// }else{
			// $this->error('操作失败',null,0);
		// }
		
		$this->display("upLoad");
	}
	
	
	public function lwh(){
		$this-> display("lwh");
	}
	public function uploadFile() {
		$upload = new \Think\Upload();
		// 实例化上传类
		$upload -> maxSize = 3145728;
		// 设置附件上传大小
		$upload -> exts = array('jpg', 'gif', 'png', 'jpeg');
		// 设置附件上传类型
		$upload -> rootPath = './Uploads/';
		// 设置附件上传根目录
		$upload -> savePath = '';
		// 设置附件上传（子）目录
		// 上传文件
		$info = $upload -> upload();
		if (!$info) {// 上传错误提示错误信息
			$this -> error($upload -> getError());
		} else {// 上传成功
			$this -> success('上传成功！');
		}
	}
}